﻿<#include "/macro.include"/> 
<#include "/custom.include"/> 
<#assign className = table.className>   
<#assign classNameLower = className?lower_case>
<#assign actionExtension = "do"> 
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<!DOCTYPE HTML>
<html>
<%
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
%>
<head>
<base  href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>${table.tableAlias}</title>
	<jsp:include page="/Commons/inc/JqueryLet.jsp"></jsp:include>
	<script type="text/javascript" src="<%=basePath%>/Commons/JS/CommonUtil.js"></script>
	<script type="text/javascript" src="<%=basePath%>/${basepackage_dir}/${namespace}/${classNameLower}.js"></script>
</head>
<body>
     <div id="Search${className}" class="easyui-window" minimizable="false" maximizable ="false"  closed="true" modal="true" title="高级查询" style="width:400px;height:300px;">
        <table style="width: 100%" >
        <tbody>
        	
        <#list table.columns as column>
					<#if column.pk>
						  
	        		<#else>
	        		       <#if column.isDateTimeColumn>
					  <tr>
                <td align="left" width="40%">${column.columnAlias}：</td><td width="60%" align="left"> <input  required="true" style="width: 150px;"  class="easyui-datebox" type="text" id="s_${column.columnNameLower}" name="s_${column.columnNameLower}"></input></td>
            </tr>
					           <#else>
					  <tr>
                <td align="left" width="40%">${column.columnAlias}：</td><td width="60%" align="left"> <input style="width: 150px;"  class="easyui-validatebox" type="text" id="s_${column.columnNameLower}" name="s_${column.columnNameLower}"></input></td>
            </tr>
					          </#if> 
	        		</#if>
	        </#list>
        </tbody>   
       <tfoot>
       <tr></tr>
       <tr>
       <td colspan="2" align="right"> 
         <a href="javaScript:void(0)" onclick="searchData();" class="easyui-linkbutton" plain="true"  iconCls="icon-ok">确定</a>
         <a href="javaScript:void(0)" onclick="$('#Search${className}').window('close');" plain="true"  class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
       </td>
       </tr>
       </tfoot>
       </table> 
     </div>

	 <div id="${className}" class="easyui-window" closed="true" minimizable="false" maximizable ="false"  modal="true" title="${table.tableAlias}" style="width:400px;height:300px;">
 <form id="${className}Form" action="update${className}" method="post">
        <table  style="width: 100%" >
        <tbody>
       <#list table.columns as column>
					<#if column.pk>
						  <input style="width: 150px;"  class="easyui-validatebox" type="hidden" id="${column.columnNameLower}" name="${column.columnNameLower}"  ></input>    
	        		<#else>
	        		       <#if column.isDateTimeColumn>
					  <tr>
                <td align="left" width="40%">${column.columnAlias}：</td><td width="60%" align="left"> <input  <#if !column.nullable> required="true" missingMessage="${column.columnAlias}是必填项！" </#if> style="width: 150px;"  style="width: 255px;" class="easyui-datebox" type="text" id="${column.columnNameLower}" name="${column.columnNameLower}"></input></td>
            </tr>
					           <#else>
					  <tr>
                <td align="left" width="40%">${column.columnAlias}：</td><td width="60%" align="left"> <input style="width: 250px;" <#if !column.nullable> required="true"  </#if> <#if column.isNumberColumn> class="easyui-numberbox"<#else> class="easyui-validatebox" </#if>  type="text" id=${column.columnNameLower}" name="${column.columnNameLower}"></input></td>
            </tr>
					          </#if> 
	        		</#if>
	        </#list>
<@generateJavaManyToOne/>
<#macro generateJavaManyToOne>
	<#list table.importedKeys.associatedTables?values as foreignKey>
	<#assign fkSqlTable = foreignKey.sqlTable>
	<#assign fkTable    = fkSqlTable.className>
	<#assign fkPojoClass = fkSqlTable.className>
	<#assign fkPojoClassVar = fkPojoClass?uncap_first>
	<#list foreignKey.parentColumns?values as fkColumn>
	 <#if fkColumn_has_next></#if>
	 <tr>
	  <td align="left" width="40%">
	  	<input    style="width: 150px;"  class="easyui-combobox" 
					name="${fkColumn}"
					url="${classNameLower}_init${fkPojoClass}.do" 
					valueField="guid" 
					textField="name" 
					panelHeight="auto">
		</td>			
	 </tr>
	  </#list>															
	</#list>
</#macro>
        </tbody>   
       <tfoot>
       <tr></tr>
       <tr>
       <td colspan="2" align="right"> 
         <a href="javaScript:void(0)" onclick="ajaxSubmit();" class="easyui-linkbutton" plain="true" iconCls="icon-ok">确定</a>
         <a href="javaScript:void(0)" onclick="$('#${className}').window('close');" plain="true"  class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
       </td>
       </tr>
       </tfoot>
       </table> 
   </form>
 </div>

 <table  id="${className}List">
 </table>
</body>
</html>
 

